<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use Watson\Validating\ValidatingTrait;

class Semester extends Model
{
    use  Notifiable;
    use ValidatingTrait;
    use SoftDeletes;
    protected $table = 'semesters';
    //
    protected $fillable = [
        's_name','begin','s_week','times_temp','end'
    ];
    protected $rules = [
        's_name' => 'required|max:20|unique',
    ];


    protected $validationMessages = [
        's_name.required' => '学期名称必填',
        's_name.max' => '学期名称长度不得超过20个字符',
        's_name.unique' => '该学期已经被注册过了'
    ];
}
